﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameplayTagContainer.h"
#include "Engine/DataAsset.h"
#include "AttributeInfo.generated.h"

USTRUCT(BlueprintType)
struct FStarrySkyAttributeInfo
{
	GENERATED_BODY()

	//所属属性对应的游戏标签
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	FGameplayTag AttributeTag=FGameplayTag();

	//属性名称
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	FText AttributeName=FText();

	//属性描述
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	FText AttributeDescription=FText();

	//属性值，这个值不能从蓝图设置应该是服务器传到客户端
	UPROPERTY(BlueprintReadOnly)
	float AttributeValue=0.f;
};

/**
 * 
 */
UCLASS()
class STARRYSKY_API UAttributeInfo : public UDataAsset
{
	GENERATED_BODY()
public:
	//维护结构体数组
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	TArray<FStarrySkyAttributeInfo> AttributeInformation;

	//根据游戏标签获取属性结构体信息
	FStarrySkyAttributeInfo FindAttributeInfoByTag(const FGameplayTag& AttributeTag, bool bLogNotFound=false) const;
};
